package com.stackoverflow;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;


public class StackOverflowReaderActivity extends Activity implements OnClickListener  {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        View soButton = findViewById(R.id.so);
        soButton.setOnClickListener(this);
        
        View msoButton = findViewById(R.id.mso);
        msoButton.setOnClickListener(this);
        
        View sfButton = findViewById(R.id.sf);
        sfButton.setOnClickListener(this);
        
        View suButton = findViewById(R.id.su);
        suButton.setOnClickListener(this);
    }
    
    public void onClick(View v) {
    	switch (v.getId()) {
	    	case R.id.so:
	    		Retriever.getInstance().setSite("stackoverflow");
	    		break;
	    	case R.id.mso:
	    		Retriever.getInstance().setSite("metastackoverflow");
	    		break;
	    	case R.id.sf:
	    		Retriever.getInstance().setSite("serverfault");
	    		break;
	    	case R.id.su:
	    		Retriever.getInstance().setSite("superuser");
	    		break;
    	}
    	startActivity(new Intent(this, SiteMenu.class));
    }
}